package test.hello7;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

@Controller
public class IndexController {

    @RequestMapping(value = {"/", "/view"})
    public String view() {
        System.out.println("IndexController.view");
        return "index";
    }


    @RequestMapping(value = {"/1", "/view1"})
    public String view1(Map<String, Object> map) {
        map.put("name", "SpringBoot");
        map.put("date", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        return "index1";
    }
}
